<?php
error_reporting(E_ALL ^ E_NOTICE);
require_once('config.php');
$status = $_POST['id_status'];
$result='';


	if($status==2){$query="SELECT a.*, b.stock_rts as jumlah FROM tb_jns_barang AS a LEFT JOIN tb_temp_rts AS b ON (a.id_jns_brg=b.id_jns_brg)";}
	else if($status==1){$query="SELECT a.*, b.stock_rtu as jumlah FROM tb_jns_barang AS a LEFT JOIN tb_temp_rts AS b ON (a.id_jns_brg=b.id_jns_brg)";}
	$fetch = mysql_query($query); 
		/* Retrieve and store in array the results of the query.*/
		while ($row = mysql_fetch_array($fetch)) {
			$result .= "<option ></option><option value='".$row[id_jns_brg]."'>$row[nama_brg]=>$row[jumlah] Karton</option>";
	    }


echo $result;
?>

